﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model List<Com.HaoJun.Mall.Model.AdminUser>

<div class="daohang">
    <ul>
        <li>
            <button type="button" class="am-btn am-btn-default am-radius am-btn-xs">
                首页
        </li>
        <li>
            <button type="button" class="am-btn am-btn-default am-radius am-btn-xs">
                帮助中心<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
            </button>
        </li>
        <li>
            <button type="button" class="am-btn am-btn-default am-radius am-btn-xs">
                奖金管理<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
            </button>
        </li>
        <li>
            <button type="button" class="am-btn am-btn-default am-radius am-btn-xs">
                产品管理<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
            </button>
        </li>
    </ul>
</div>



<div class="admin-biaogelist">
    <div class="listbiaoti am-cf">
        <ul class="am-icon-flag on">
            管理员管理
        </ul>
        <dl>
            <button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus" onclick="window.location='Index'">添加管理员</button>
        </dl>
        <!--data-am-modal="{target: '#my-popup'}" 弹出层 ID  弹出层 190行 开始  271行结束-->

    </div>
    <form class="am-form am-g">
        <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
            <thead>
                <tr class="am-success">
                    <th class="table-id am-text-center">ID</th>
                    <th class="table-title">用户名</th>
                    <th width="163px" class="table-set">操作</th>
                </tr>
            </thead>
            <tbody>
                @{
                    foreach (var item in Model)
                {
                        <tr>
                        <td class="am-text-center">@item.Id</td>
                        <td>@item.UserName</td>
                        <td>
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                        <a class="am-btn am-btn-default am-btn-xs am-text-secondary am-round" href="Index?id=@item.Id" title="修改"><span class="am-icon-pencil-square-o"></span></a>
                                    <!-- 用按钮的时候 弹层 后缀需要加 问好 ？#的 时候才有效 真恶心 .html?# -->
                                        <a class="am-btn am-btn-default am-btn-xs am-text-danger am-round" title="删除" id="@item.Id" onclick="de(this.id)"><span class="am-icon-trash-o"></span></a>
                                </div>
                            </div>
                        </td>
                    </tr>
                }
                }
            </tbody>
        </table>

        <hr />

    </form>
</div>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script>
    function de(m) {
        $.get("http://www.mall.com/v1/Admin/Delete?Id=" + m, {}, function (data) {
            if (data.returncode == 0 && data.result == 0) {
                //window.location.reload();
                $("#tr"+m).fadeOut();
            }
        })
    }
</script>